var menuWindow = Ti.UI.createWindow({
    top:0,
    left:0,
    width:190,
    backgroundColor:'#B50E49',
    backgroundImage: '/images/backgr.jpg'
});

menuWindow.open();
//// ---- Menu Table
var createTableViewRow = function(rowData){
	
	if(rowData.isSepa){
		var row = Ti.UI.createTableViewRow({
			height:8,
			backgroundColor:'transparent'
		});
		return row;
	}
	else
	{
		var row = Ti.UI.createTableViewRow({
			height:44,
			backgroundGradient: {
		      type: 'linear',
		      colors: ['#f9f9f9','#d7d7d7'],
		      startPoint: {x:0,y:0},
		      endPoint:{x:0,y:44},
		      backFillStart:false}
		});

		var img = Ti.UI.createImageView({
			image:rowData.imagePath,
			width:35,
			height:35,
			left:1
		});
	
		row.add(img);
	
		var title = Ti.UI.createLabel({
			color:'',
			left:45,
			width:Ti.UI.FILL,
			height:Ti.UI.FILL,
			text:rowData.title,
			font:{
				fontFamily:'Arial-BoldMT',
				fontWeight:'bold',
				fontSize:17
			}
		});
		row.add(title);
		
		if(rowData.hasDetail){
			var detail = Ti.UI.createImageView({
				right:90,
				width:8,
				height:13,
				image:'/images/arrow.png'
			});
			//row.add(detail);
		}

		return row;
	}
	
};

var data = [
	{ title:'Employees', hasDetail:true, imagePath:'/images/Emp.png', isSepa:false },
	{ isSepa: true},
	{ title:'Timesheet', hasDetail:true, imagePath:'/images/time_sheet.png', isSepa:false},
	{ title:'Leave Application', hasDetail:true, imagePath:'/images/leave.png', isSepa: false},
	{ title:'Travel Request', hasDetail:true, imagePath:'/images/travel.png', isSepa: false},
	{ title:'Claims', hasDetail:true, imagePath:'/images/wallet.png', isSepa: false},
	{ isSepa: true},
	{ title:'Settings', hasDetail:true, imagePath:'/images/Setting-icon.png', isSepa: false},
	{ title:'Social Media', hasDetail:true, imagePath:'/images/social.png', isSepa: false}
];

var rows = [];

for(i=0; i<data.length; i++) {
	rows.push(createTableViewRow(data[i]));
}

// Menu Titles

// Tableview
var tableView = Ti.UI.createTableView({
    data:rows
});
menuWindow.add(tableView);